package com.ruoyi.dl.controller.wechat;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.dl.domain.DlActivity;
import com.ruoyi.dl.service.IDlActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 活动Controller
 *
 * @author wangshouli
 * @date 2021-01-05
 */
@Controller
@RequestMapping("/wechat/dl/activity")
@CrossOrigin(allowCredentials = "true")
public class WeChatDlActivityController extends BaseController {

    @Autowired
    private IDlActivityService iDlActivityService;

    /**
     * 查询所有活动
     *
     * @return
     */
    @PostMapping("/selectALLActivity")
    @ResponseBody
    public AjaxResult selectALLActivity() {
        return AjaxResult.success("成功", iDlActivityService.selectDlActivityList(new DlActivity()));
    }

    @PostMapping("/selectActivityById")
    @ResponseBody
    public AjaxResult selectActivityById(Integer activityId) {
        return AjaxResult.success("成功", iDlActivityService.selectDlActivityById(activityId.longValue()));
    }

}
